package com.jyw.system.domain.vo;

import com.jyw.common.annotation.Conversion;
import com.jyw.system.domain.SysUserTeam;
import com.jyw.system.utils.UserUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.FieldNameConstants;

/**
 * @author 沈峻
 * @ClassName TeamUserVo
 * @Description TODO
 * @Date 2023/9/6 15:14
 **/
@ApiModel("小组用户对象")
@Data
@NoArgsConstructor
@FieldNameConstants
public class SimpleUserVo {

    @ApiModelProperty("用户id")
    @Conversion(name = Fields.nickName)
    private Long userId;

    @ApiModelProperty("用户名称")
    private String nickName;


    public SimpleUserVo(SysUserTeam data) {
        setUserId(data.getUserId());
        setNickName(UserUtils.userIdToName(data.getUserId()));
    }

    public SimpleUserVo(Long userId) {
        this.userId = userId;
    }
}
